package com.wswy.wzcx.model;

import android.os.Parcel;
import android.os.Parcelable.Creator;
import android.text.TextUtils;
import com.google.gson.annotations.SerializedName;

public class PaymentOrder implements android.os.Parcelable {

  @SerializedName("pay")
  private  String pay;

  @SerializedName("orderNo")
  private String orderNo;

  @SerializedName("amount")
  private String amount;

  @SerializedName("referer")
  private String referer;

  private String bizType;
  private int payStyle;

  public void setPay(String pay) {
    this.pay = pay;
  }

  public void setAmount(String amount) {
    this.amount = amount;
  }

  public void setPayStyle(int payStyle) {
    this.payStyle = payStyle;
  }

  public void setOrderNo(String orderNo) {
    this.orderNo = orderNo;
  }

  public String getPay() {
    return pay;
  }

  public String getOrderNo() {
    return orderNo;
  }

  public int getPayStyle() {
    return payStyle;
  }

  public boolean isSuccess(){
    return !TextUtils.isEmpty(pay) && !TextUtils.isEmpty(orderNo);
  }

  public String getAmount() {
    return amount;
  }

  public String getBizType() {
    return bizType;
  }

  public void setBizType(String bizType) {
    this.bizType = bizType;
  }

  public String getReferer() {
    return referer;
  }

  public void setReferer(String referer) {
    this.referer = referer;
  }

  @Override
  public String toString() {
    return "PaymentOrder{" +
        "orderNo='" + orderNo + '\'' +
        ", amount='" + amount + '\'' +
        ", bizType='" + bizType + '\'' +
        ", payStyle=" + payStyle +
        '}';
  }


  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(this.pay);
    dest.writeString(this.orderNo);
    dest.writeString(this.amount);
    dest.writeString(this.bizType);
    dest.writeInt(this.payStyle);
  }

  public PaymentOrder() {
  }

  protected PaymentOrder(Parcel in) {
    this.pay = in.readString();
    this.orderNo = in.readString();
    this.amount = in.readString();
    this.bizType = in.readString();
    this.payStyle = in.readInt();
  }

  public static final Creator<PaymentOrder> CREATOR = new Creator<PaymentOrder>() {
    @Override
    public PaymentOrder createFromParcel(Parcel source) {
      return new PaymentOrder(source);
    }

    @Override
    public PaymentOrder[] newArray(int size) {
      return new PaymentOrder[size];
    }
  };
}
